Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

Backporting wasm cast fixes #99

Merged

Conversation

alexcrichton
Copy link
Member

No description provided.

Dan Gohman added 2 commits November 29, 2017 21:03
This adds code to protect WebAssembly's `trunc_s` family of opcodes
from values outside their domain. Even though such conversions have
full undefined behavior in C/C++, LLVM IR's `fptosi` and `fptoui` do
not, and only return undef.

This also implements the proposed non-trapping float-to-int conversion
feature and uses that instead when available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319128 91177308-0d34-0410-b5e6-96231b3b80d8
To fully avoid trapping on wasm, fptoui needs a second check to ensure that
the operand isn't below the supported range.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319354 91177308-0d34-0410-b5e6-96231b3b80d8
@alexcrichton alexcrichton merged commit 6d08185 into rust-lang:rust-llvm-release-4-0-1 Nov 30, 2017
@alexcrichton alexcrichton deleted the fix-wasm-casts branch November 30, 2017 13:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant